
'use strict'

const config = require('./webpack.dev.js')
const express = require('express')
const webpack = require('webpack')
const webpackDevMiddleware = require('webpack-dev-middleware')
const compiler = webpack(config)
const app = express()

app.use(webpackDevMiddleware(compiler, {
  publicPath: config.output.publicPath,
}))


app.use(express.static(__dirname + '/example'))

app.listen(8080, err => {
  if (err) {
    return console.error(err)
  }

  console.info('Listening at localhost:8080')
})
